<?php

namespace app\admin\model\stock;

use think\Model;

/**
 * Stockmaster
 */
class Stockmaster extends Model
{
    // 表主键
    protected $pk = 'stockid';
    
    // 表名
    protected $name = 'stock_stockmaster';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;


    public function unitsTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\setup\Unitsofmeasure::class, 'units', 'unitname');
    }

    public function categoryidTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\stock\Stockcategory::class, 'categoryid', 'categoryid');
    }

    public function taxcatidTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\setup\Taxcategories::class, 'taxcatid', 'taxcatid');
    }
}